package edu.ucla.cs.typecast.util;

import java.io.*;

public class CountServerImpl implements CountServer, Serializable {
	private static final long serialVersionUID = 1L;
	
	protected int count = 0;
	
	public boolean equals(Object o) {
		if (o != null && o instanceof CountServerImpl) {
			return ((CountServerImpl) o).count == count;
		} else {
			return false;
		}
	}

	public int getCount() {
		return count;
	}

	public void incCount() {
		count++;
	}

	public void resetCount() {
		count = 0;
	}
	
	public String toString() {
		return this.getClass().getName() + "[count: " + count + "]";
	}
}
